package com.jml.forkjoin;


public class Test002 implements JmlCallable<String> {
    @Override
    public String call() throws Exception {
        try {
            Thread.sleep(3000);
            System.out.println(Thread.currentThread().getName() + ",发送短信完成..");
            return null;
        } catch (Exception e) {
            return "发送短信失败.";
        }
    }

    public static void main(String[] args) {
        手写lFutureTask<String> jmlFutureTask = new 手写lFutureTask<>(new Test002());
        new Thread(jmlFutureTask).start();
        String s = jmlFutureTask.get();
        System.out.println("手写future 模式 获取结果" + s);
    }
}
